import i18n from "i18n-js";
import PageContainer from "@/components/PageContainer";
import { DynamicColors, GStyleSheet } from "@/utils/DarkMode";
import { View } from "@tarojs/components";
import DashedTitle from '@/components/DashedTitle';
import { networkConfigTypes } from '@/config/product';
import configWifiModel from '../models/configWifi';
import SoftApConfig from './softApConfig';
import BTWifiConifg from './BTWifiConifg';

const dstyles = GStyleSheet.create({
  container: {
    width: "100%",
    height: "100%",
    padding: "32rpx",
    boxSizing: "border-box",
    display: 'flex',
    flexDirection: 'column',
  },
  bg: {
    backgroundColor: DynamicColors.cardBackgroundColor,
  }
});


const LoadingPage = () => {

  const styles = dstyles.useDynamicStyle();

  return (
    <PageContainer title={i18n.t('ADD_DEVICE')} style={styles.bg}>
      <View style={styles.container}>
        <DashedTitle
          title={i18n.t('SEARCH_AND_BIND_DEVICE')}
          num={3}
          isDashed
          isEnd
        />
        {/* <BTWifiConifg /> */}
        {configWifiModel.configModel!.type === networkConfigTypes.TNetworkConfigTypeSoftAp && <SoftApConfig />}
        {configWifiModel.configModel!.type === networkConfigTypes.TNetworkConfigTypeBTWifi && <BTWifiConifg productConfig={configWifiModel.productConfig} />}
      </View>
    </PageContainer>
  );
};

export default LoadingPage;
